<?php

$query = "select CE.id_Equipo as ID,CE.nom_Equipo as EQUIPO,(TG.j_Ganados + TG.j_Empatados + TG.j_Perdidos) as JJ,TG.j_Ganados as JG,TG.j_Empatados as JE,TG.j_Perdidos as JP,TG.g_Favor as GF,TG.g_Contra as GC,((TG.j_Ganados * 3) + TG.j_Empatados) as PTS,(TG.g_Favor - TG.g_Contra) as DIF from Tab_General as TG inner join Cat_Equipos as CE on TG.id_Equipo=CE.id_Equipo where CE.id_Fuerza=2 order by PTS desc,DIF desc,GF desc,JG desc";
$result = mysql_query($query);
$numero = 1;
while ($row = mysql_fetch_array($result)) {
    if ($row["ID"] == 7) {
        echo "<tr style=\"background: #0431B4; color: #fff;\"><td aling=\"center\"><center><font face=\"verdana\">" .
        $numero . "</font></center></td>";
        echo "<td><font face=\"verdana\">" .
        $row["EQUIPO"] . "</font></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["JJ"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["JG"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["JE"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["JP"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["GF"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["GC"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["PTS"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["DIF"] . "</font></center></td></ytr>";
        $numero++;
    } else {
        echo "<tr><td aling=\"center\"><center><font face=\"verdana\">" .
        $numero . "</font></center></td>";
        echo "<td><font face=\"verdana\">" .
        $row["EQUIPO"] . "</font></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["JJ"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["JG"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["JE"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["JP"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["GF"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["GC"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["PTS"] . "</font></center></td>";
        echo "<td><center><font face=\"verdana\">" .
        $row["DIF"] . "</font></center></td></ytr>";
        $numero++;
    }
}
mysql_free_result($result);
mysql_close($link);
?>